<?php

namespace App\Models;

class Role extends Base
{
    protected $table = 'roles';

    protected $fillable = [
        'id','title','brief','rules', 'created_at', 'updated_at'
    ];

    protected $casts = [
        'rules' => 'array'
    ];


    protected function list()
    {
        return $this->select(['id','title','brief','created_at'])
            ->orderBy('id', 'desc')
            ->paginate(config('setting.limit'));
    }


    protected function tree(){
        return $this->select(['id','title'])
            ->orderBy('id', 'asc')
            ->get();
    }



}
